home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Techniques / pacManOnMarsSourceV3 / __READ ME__ next >
Text File  |  2001-01-05  |  3KB  |  16 lines

  1. "PacMan On Mars"
  2.  
  3. REALbasic's SpriteSurface feature implements a sprite world. This used to consist of a game animation of the sort where the screen goes black and the game takes over your computer. In REALbasic 3, this sprite-world happens in an ordinary control in an ordinary window. This project, PacMan On Mars, illustrates the SpriteSurface feature with a little game that's simple but fun to play; you use the arrow keys to aim PacMan at the ghosts who are bouncing around, uh, on Mars (don't ask).
  4.  
  5. The project is a good example of all game animation features: SpriteSurfaces, Sprites, moving the sprites, changing their appearance as they move, collisions, responding to keys, scrolling the background. The only feature that isn't used is the new Update command (the Run command is used instead). The project also shows several other interesting techniques, such as how to incorporate a movie as a resource.
  6.  
  7. At the heart of this project are two abstract classes, SmartSurface and SmartSprite, that make REALbasic's own SpriteSurface and Sprite classes much more object-oriented; you can use these abstract classes in your own games, to make them easier to construct.
  8.  
  9. Note to readers of my book: This is the game developed in Chapter 28 of my book, with some modifications from the original. New Events have been completely replaced by virtual methods. Also, in the late stages of the run-up to the release of REALbasic version 2.1, the bug that prevented rerunning a closed SpriteSurface was fixed, and the bug that caused a crash when a sprite went out of bounds while the background was scrolling was fixed. Then, scrolling itself was overhauled in RB, and the project had to be heavily revised in order to cope; notice how we now must keep track of our horizontal "position", because the origin moves as we scroll. The trick where the SmartSprite is a wrapper for Sprite is no longer needed, since now it is possible for it to be a subclass of Sprite; this in turn means that it is instantly obvious during a collision which SmartSprites are involved, so there is no need to cycle through the whole array looking for them. Finally, there is no longer a Graphics property of the SpriteSurface, so we write into the surrounding window instead.
  10.  
  11. matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt
  12.           *** REALbasic: The Definitive Guide! ***
  13. http://www.amazon.com/exec/obidos/ASIN/1565926579/somethingsbymatt
  14. Ch. 3: http://www.oreilly.com/catalog/realbasic/chapter/ch03.html
  15. -- See my home page for latest news, tutorials, examples, etc. --
  16.